/*
 * tento.c (part of p8.c)
 *  
 *
 *  Created by Shang-Ju Chen on 3/5/11.
 *  
 *
 */

long double
tento( int n )
{
	long double y,z;
	if(n < 0)
	{
		return ((long double) 1 /tendo(-n));
	}
	else
	{
		z = (long double) 10;
		y = (n & 1 ? z: (long double) 1);
		
		for ( ; n >>= 1; )
		{
			z = z * z;
			if (n & 1)
			{
				y = y * z;
			}
		}
		
		return (y);
	}
}
